<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    
<%@page import="java.sql.*,java.util.*" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Degree Location</title>
</head>
<body>

<%
	ResultSet rset;
	rset = (ResultSet) request.getAttribute("crsStates");
	Vector<String> states = new Vector<String>();
	Vector<String> statesID = new Vector<String>();
	while(rset.next())
	{
		statesID.add(rset.getString("id"));
		states.add(rset.getString("state"));
	}

	rset = (ResultSet) request.getAttribute("crsCountries");
	Vector<String> countries = new Vector<String>();
	Vector<String> countryID = new Vector<String>();
	while(rset.next())
	{
		countryID.add(rset.getString("id"));
		countries.add(rset.getString("country"));
	}

%>
	<br>

	<c:set var="studentData" scope="page" value="${sessionScope.StudentData}" />

	<c:forEach items="${formData}" var="line">
		<c:out value="${line}" /><br>
	</c:forEach>
	<br>
	<br>
	

	Where did you receive your degree?<br><br>United States<br><br>

	<div id="left_wrapper">
	<div id="left">
	<p>

	<%
	for (int i = 0; i < states.size() / 3; i++)
	{ %>
		
		<html:link action="/pages/students/degreeLocation">
			<html:param name="stateID" value="<%= statesID.get(i) %>" />
			<html:param name="degreeCountry" value="<%= states.get(i) %>" />
			<%= states.get(i) %>
		</html:link>
		<br>
	<% } %>

	</p>
	</div>
	</div>

	<div id="middle_wrapper">
	<div id="left">
	<p>

	<%
	for (int i = states.size() / 3; i < 2 * (states.size() / 3); i++)
	{ %>
		<html:link action="/pages/students/degreeLocation">
			<html:param name="stateID" value="<%= statesID.get(i) %>" />
			<html:param name="degreeCountry" value="<%= states.get(i) %>" />
			<%= states.get(i) %>
		</html:link>
		<br>
	<% } %>

	</p>
	</div>
	</div>

	<div id="right_wrapper">
	<div id="right">
	<p>
	
	<%
	for (int i = 2 * (states.size() / 3); i < states.size(); i++)
	{ %>
		<html:link action="/pages/students/degreeLocation">
			<html:param name="stateID" value="<%= statesID.get(i) %>" />
			<html:param name="degreeCountry" value="<%= states.get(i) %>" />
			<%= states.get(i) %>
		</html:link>
		<br>
	<% } %>

	</p>
	</div>
	</div>

	

	<br><br>Countries<br><br>

	<div id="left_wrapper">
	<div id="left">
	<p>

	<%
	for (int i = 0; i < countries.size() / 3; i++)
	{ %>
		<html:link action="/pages/students/degreeLocation">
			<html:param name="countryID" value="<%= countryID.get(i) %>" />
			<html:param name="degreeCountry" value="<%= countries.get(i) %>" />
			<%= countries.get(i) %>
		</html:link>
		<br>
		
	<% } %>

	</p>
	</div>
	</div>

	<div id="middle_wrapper">
	<div id="left">
	<p>

	<%
	for (int i = countries.size() / 3; i < 2 * (countries.size() / 3); i++) 
	{ %>
		<html:link action="/pages/students/degreeLocation">
			<html:param name="countryID" value="<%= countryID.get(i) %>" />
			<html:param name="degreeCountry" value="<%= countries.get(i) %>" />
			<%= countries.get(i) %>
		</html:link>
		<br>
	<% } %>

	</p>
	</div>
	</div>

	<div id="right_wrapper">
	<div id="right">
	<p>

	<%
	for (int i = 2 * (countries.size() / 3); i < countries.size(); i++)
	{ %>
		<html:link action="/pages/students/degreeLocation">
			<html:param name="countryID" value="<%= countryID.get(i) %>" />
			<html:param name="degreeCountry" value="<%= countries.get(i) %>" />
			<%= countries.get(i) %>
		</html:link>
		<br>
	<% } %>

	</p>
	</div>
	</div>



<br><br>

</body>
</html>